<!doctype html>
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<title>test</title>

	<script type="text/javascript" src="../../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base']"></script>
	<script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true,  has: { 'dojo-bidi': true }"></script>

	<script type="text/javascript">
		require([
			"dojo/_base/connect",
			"dojo/ready",
			"dojo/_base/array",
			"dojo/dom",
			"dijit/registry",
			"dojox/mobile/parser",
			"dojox/mobile",
			"dojox/mobile/compat",
			"dojox/mobile/Button",
			"dojox/mobile/Switch",
			"dojox/mobile/ListItem",
			"dojox/mobile/ScrollableView"
		], function(connect, ready, array, dom, registry){
			ready(function(){
			
				//change textDir for switch1	
				var btn0 = registry.byId("btn0");	
				btn0.connect(btn0, "onClick", function(){
					registry.byId("switch1").set("textDir", "ltr");
				});	
				
				var btn0 = registry.byId("btn1");	
				btn0.connect(btn0, "onClick", function(){
					registry.byId("switch1").set("textDir", "rtl");
				});	
					
				var btn0 = registry.byId("btn2");	
				btn0.connect(btn0, "onClick", function(){
					registry.byId("switch1").set("textDir", "auto");
				});
				// change label for icon container				
				var btnLbl = registry.byId("btnLbl");
				btnLbl.connect(btnLbl, "onClick", function(){
				var c = registry.byId("switch6");
				var l = c.get("label");
				c.set("label", "new");
				var n =  c.get("label");
				
					registry.byId("switch6").set("leftLabel", "\u05e9\u05dc\u05d5\u05dd!");
				});
			});
	
	});
	</script>

	<style>
	html,body {
		height: 100%;
		overflow: hidden;
	}
	hr {
		border: none;
		margin: 0;
	}
	button {
		width: 180px;
		margin: 15px 10px 0;
	}
	button.customButton {
		border-color: #cc3333;
		background-image: url(../images/red-button-bg.png);
		background-image: -webkit-gradient(linear, left top, left bottom, from(#D3656D), to(#BC1320), color-stop(0.5, #C9404B), color-stop(0.5, #BC1421));
		color: #ffffff;
	}
	</style>
</head>
<body style="visibility:hidden;">
<div id="group1" data-dojo-type="dojox.mobile.View" data-dojo-props='keepScrollPos:false'><!-- keepScrollPos=false is to improve performance -->
	<div id="view0" data-dojo-type="dojox.mobile.ScrollableView">
	        <h2 data-dojo-type="dojox.mobile.Heading">Switch widget</h2>
		<h1 data-dojo-type="dojox.mobile.Heading">dir LTR</h1>	
		<ul data-dojo-type="dojox.mobile.EdgeToEdgeList" >
			<li id="l1" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/LTR.png", moveTo:"view1"'>Tex Dir LTR</li>
			<li id="l2" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/RTL.png", moveTo:"view2"'>Tex Dir RTL</li>
			<li id="l3" data-dojo-type="dojox.mobile.ListItem"  data-dojo-props='icon:"../images/auto.png", moveTo:"view3"'>Tex Dir AUTO</li>
		</ul>
		<h1 data-dojo-type="dojox.mobile.Heading">dir RTL</h1>
		<ul data-dojo-type="dojox.mobile.EdgeToEdgeList" >
			<li id="l4" data-dojo-type="dojox.mobile.ListItem"  data-dojo-props='icon:"../images/LTR.png", moveTo:"view4"'>Tex Dir LTR</li>
			<li id="l5" data-dojo-type="dojox.mobile.ListItem"  data-dojo-props='icon:"../images/RTL.png", moveTo:"view5"'>Tex Dir RTL</li>
			<li id="l6" data-dojo-type="dojox.mobile.ListItem"  data-dojo-props='icon:"../images/auto.png", moveTo:"view6"'>Tex Dir AUTO</li>
		</ul>	
	</div>	
	<div id="view1" data-dojo-type="dojox.mobile.ScrollableView">
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir LTR | textDir LTR</h1>
		<div data-dojo-type="dojox/mobile/RoundRect" data-dojo-props='shadow:true, textDir:"ltr"'>
				
		<div  id="switch1" class="color1" data-dojo-type="dojox/mobile/Switch" data-dojo-props='value:"on", leftLabel:"Hello!", rightLabel:"&#1513;&#1500;&#1493;&#1501;!"'></div>
		<br>
		<div  id="switch2" class="color1" data-dojo-type="dojox/mobile/Switch" data-dojo-props='value:"on", leftLabel:"A&#1505;&#1493;&#1507;!", rightLabel:"&#1488;end!"'></div>
		</div>
		
		<button data-dojo-type="dojox.mobile.Button" id="btn0" >Set textDir for switch to ltr</button>
		<button data-dojo-type="dojox.mobile.Button" id="btn1" >Set textDir for switch to rtl</button>
		<button data-dojo-type="dojox.mobile.Button" id="btn2" >Set textDir for switch to auto</button>
		
			
	</div>	
	<div id="view2" data-dojo-type="dojox.mobile.ScrollableView">
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir LTR | textDir RTL</h1>
		<div data-dojo-type="dojox/mobile/RoundRect" data-dojo-props='shadow:true, textDir:"rtl"'>
				
		<div  id="switch3" class="color1" data-dojo-type="dojox/mobile/Switch" data-dojo-props='value:"on", leftLabel:"Hello!", rightLabel:"&#1513;&#1500;&#1493;&#1501;!"'></div>
		<br>
		<div  id="switch4" class="color1" data-dojo-type="dojox/mobile/Switch" data-dojo-props='value:"on", leftLabel:"A&#1505;&#1493;&#1507;!", rightLabel:"&#1488;end!"'></div>
		</div>
					
		
	</div>
		
	<div id="view3" data-dojo-type="dojox.mobile.ScrollableView">	
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir LTR | textDir AUTO</h1>
		<div data-dojo-type="dojox/mobile/RoundRect" data-dojo-props='shadow:true'>
				
		<div  id="switch5" class="color1" data-dojo-type="dojox/mobile/Switch" data-dojo-props='value:"on", textDir:"auto", leftLabel:"Hello!", rightLabel:"&#1513;&#1500;&#1493;&#1501;!"'></div>
		<br>
		<div  id="switch6" class="color1" data-dojo-type="dojox/mobile/Switch" data-dojo-props='value:"on", textDir:"auto", leftLabel:"A&#1505;&#1493;&#1507;!", rightLabel:"&#1488;end!"'></div>
		</div>	
		
		<button data-dojo-type="dojox.mobile.Button" id="btnLbl" >Set new text Button</button>	
		
	</div>	
	 
	<div dir="rtl" id="view4" data-dojo-type="dojox.mobile.ScrollableView">
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir RTL | textDir LTR</h1>
		<div data-dojo-type="dojox/mobile/RoundRect" data-dojo-props='shadow:true, textDir:"ltr"'>
				
		<div  id="switch7" class="color1" data-dojo-type="dojox/mobile/Switch" data-dojo-props='value:"on", leftLabel:"Hello!", rightLabel:"&#1513;&#1500;&#1493;&#1501;!"'></div>
		<br>
		<div  id="switch8" class="color1" data-dojo-type="dojox/mobile/Switch" data-dojo-props='value:"on", leftLabel:"A&#1505;&#1493;&#1507;!", rightLabel:"&#1488;end!"'></div>
		</div>
		
		
	</div>
	<div id="view5" data-dojo-type="dojox.mobile.ScrollableView">
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir RTL | textDir RTL</h1>
		<div data-dojo-type="dojox/mobile/RoundRect" data-dojo-props='shadow:true, textDir:"rtl"'>
				
		<div  id="switch9" dir="rtl" class="color1" data-dojo-type="dojox/mobile/Switch" data-dojo-props='value:"on", leftLabel:"Hello!", rightLabel:"&#1513;&#1500;&#1493;&#1501;!"'></div>
		<br>
		<div  id="switch10" dir="rtl" class="color1" data-dojo-type="dojox/mobile/Switch" data-dojo-props='value:"on", leftLabel:"A&#1505;&#1493;&#1507;!", rightLabel:"&#1488;end!"'></div>
		</div>		
		
	</div>	
	<div dir="rtl" id="view6" data-dojo-type="dojox.mobile.ScrollableView">	
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir RTL | textDir AUTO</h1>
		<div data-dojo-type="dojox/mobile/RoundRect" data-dojo-props='shadow:true, textDir:"auto"'>
				
		<div  id="switch11" class="color1" data-dojo-type="dojox/mobile/Switch" data-dojo-props='value:"on", leftLabel:"Hello!", rightLabel:"&#1513;&#1500;&#1493;&#1501;!"'></div>
		<br>
		<div  id="switch12" class="color1" data-dojo-type="dojox/mobile/Switch" data-dojo-props='value:"on", leftLabel:"A&#1505;&#1493;&#1507;!", rightLabel:"&#1488;end!"'></div>
		</div>			
		
	</div>	
</div>

</div>
</body>
</html>
